package refletion;

/**
 * @program: thread
 * @description:
 * @author: gongj
 * @Description: TODO
 * @create: 2020-06-04 21:31
 **/
public class Test5 {
    public static void main(String[] args) throws ClassNotFoundException {
        //获得系统类的加载类
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);

        //获得系统类的加载类的父类加载器 ==》 扩展类加载器
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(parent);

        //获得扩展类加载器的父类加载器  ==》根加载器(c/c++)
        ClassLoader parent1 = parent.getParent();
        System.out.println(parent1);

        //获得当前类是哪个加载器加载的
        ClassLoader classLoader1 = Class.forName("refletion.Test5").getClassLoader();
        System.out.println(classLoader1);

        //获得jdk内置的类是谁加载的
        ClassLoader classLoader = Class.forName("java.lang.Object").getClassLoader();
        System.out.println(classLoader);

        //获得系统类加载器可以加载的路径
        System.out.println(System.getProperty("java.class.path"));
        /**
         * D:\tools\java\jdk\jre\lib\charsets.jar;
         * D:\tools\java\jdk\jre\lib\deploy.jar;
         * D:\tools\java\jdk\jre\lib\ext\access-bridge-64.jar;
         * D:\tools\java\jdk\jre\lib\ext\cldrdata.jar;
         * D:\tools\java\jdk\jre\lib\ext\dnsns.jar;
         * D:\tools\java\jdk\jre\lib\ext\jaccess.jar;
         * D:\tools\java\jdk\jre\lib\ext\jfxrt.jar;
         * D:\tools\java\jdk\jre\lib\ext\localedata.jar;
         * D:\tools\java\jdk\jre\lib\ext\nashorn.jar;
         * D:\tools\java\jdk\jre\lib\ext\sunec.jar;
         * D:\tools\java\jdk\jre\lib\ext\sunjce_provider.jar;
         * D:\tools\java\jdk\jre\lib\ext\sunmscapi.jar;
         * D:\tools\java\jdk\jre\lib\ext\sunpkcs11.jar;
         * D:\tools\java\jdk\jre\lib\ext\zipfs.jar;
         * D:\tools\java\jdk\jre\lib\javaws.jar;
         * D:\tools\java\jdk\jre\lib\jce.jar;
         * D:\tools\java\jdk\jre\lib\jfr.jar;
         * D:\tools\java\jdk\jre\lib\jfxswt.jar;
         * D:\tools\java\jdk\jre\lib\jsse.jar;
         * D:\tools\java\jdk\jre\lib\management-agent.jar;
         * D:\tools\java\jdk\jre\lib\plugin.jar;
         * D:\tools\java\jdk\jre\lib\resources.jar;
         * D:\tools\java\jdk\jre\lib\rt.jar;
         * D:\dev\lx\thread\annotate\target\classes;
         * D:\tools\idea\IntelliJ IDEA 2018.3.5\lib\idea_rt.jar
         */
    }
}
